package cc.lishixi.book.dao.mapper;

import cc.lishixi.book.entity.Parameter;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * Created by LiShixi on 2016/7/24 0024.
 * http://www.lishixi.cc
 */
/*  int id;
    int type;
    int amount;
    int period;
    float dailyfine;*/
public class ParameterRowMapper implements RowMapper<Parameter> {
    @Override
    public Parameter mapRow(ResultSet r, int i) throws SQLException {
        Parameter p = new Parameter();
        p.setId(r.getInt("id"));
        p.setType(r.getInt("type"));
        p.setAmount(r.getInt("amount"));
        p.setPeriod(r.getInt("period"));
        p.setDailyfine(r.getFloat("dailyfine"));
        return p;
    }
}
